package com.drug.common.enums;

import java.util.Arrays;

/**
 * 业务编号枚举
 *
 * @author ruoyi
 */
public enum BusinessSeqEnum {
    SP("SP", "商品编号"),
    JG("JG", "价格配置编号"),
    DW("DW", "单位配置编号"),
    CU("CU", "往来单位配置编号"),
    RK("RK", "入库单单据编号"),
    HW("HW", "货位配置编号"),
    SL("SL", "商品类别编号"),
    CK("CK", "仓库编号"),

    UNKNOWN("unknown", "未知");

    BusinessSeqEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private String code;
    private String desc;


    public static String getSeqCode(String code) {
        return Arrays.stream(BusinessSeqEnum.values())
                .filter(businessSel -> businessSel.getCode().equals(code))
                .findFirst().orElse(BusinessSeqEnum.UNKNOWN)
                .getCode();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
